#ifndef SCROLLVIEW_H
#define SCROLLVIEW_H

#include <QObject>
#include <QWidget>
#include "viewobject.h"
#include "paramobject.h"
#include <qdom.h>
#include <QEvent>
#include <QMouseEvent>
#include <QPoint>

/**********************
*      滚动字幕显示
*
*
*
*
*
***********************/


typedef struct ScrollViewParam
{
    QString m_textContent;
    QString m_textFormat;
    int m_stepWidth;
    int m_stepTime;
    ScrollViewParam()
    {
        m_textContent = "hello scroll";
        m_textFormat = "";
        m_stepWidth = 2;
        m_stepTime = 30;
    }

}ScrollViewParam;


class ScrollView : public ViewObject
{
    Q_OBJECT
public:
       static int m_id;

       Q_INVOKABLE explicit ScrollView(QWidget *parent = NULL);

       ~ScrollView();

       void  ShowObject(QWidget*, QString filename = "", QString prefix = "", ProtocolData * ptr_data = NULL);

       void HideObject();

       void DestoryObject();

       void SetAttribute(std::string);

       void ParseXML(QDomElement* );

       void PacketXML(QDomElement*);

       void GetAttribute(std::string&);

       void start();

       void stop();

protected:
     void paintEvent(QPaintEvent *event);
private:
       QTimer *m_scrollTimer;

       int m_curIndex;

       QColor m_color;

       QColor m_bk_color;

       QFont m_font;

       ScrollViewParam *m_scrollviewParam;

private slots:
       void updateIndex();
};

#endif // SCROLLVIEW_H
